home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 1 Issue 2 / PDCD-1 - Issue 02.iso / _utilities / utilities / 001 / fue / emacs_cr < prev    next >
Text File  |  1991-04-28  |  9KB  |  407 lines

  1. set $discmd FALSE
  2.  
  3. write-message "[Setting up....]"
  4.  
  5. ; If you screen "SNOWS", comment this line
  6.        set $flicker "FALSE"
  7.  
  8. ; To use an IBM-PC EGA card, uncomment the following line
  9. ;     set $sres "EGA"
  10.  
  11. ;macro 1 to toggle function key help display
  12.  
  13. add-global-mode magic
  14. add-global-mode exact
  15. add-global-mode asave
  16. add-global-mode "blue"
  17. add-global-mode "YELLOW"
  18.  
  19. execute-file "ue_mac_rc"
  20.  
  21. ;{{{  bind procedures to macros
  22. ;{{{  1=help
  23. 1 store-macro
  24.   execute-procedure help
  25. !endm
  26.  
  27. ;}}}
  28. ;{{{  2=clear-pick
  29. 2 store-macro
  30.   execute-procedure clear-pick
  31. !endm
  32.  
  33. ;}}}
  34. ;{{{  3=pick-line
  35. 3       store-macro
  36.   execute-procedure pick-line
  37. !endm
  38.  
  39. ;}}}
  40. ;{{{  4=move-line
  41. 4       store-macro
  42.   execute-procedure move-line
  43. !endm
  44.  
  45. ;}}}
  46. ;{{{  5=copy-pick
  47. 5       store-macro
  48.   execute-procedure copy-pick
  49. !endm
  50.  
  51. ;}}}
  52. ;{{{  6=put-buffer
  53. 6       store-macro   
  54.   execute-procedure put-buffer
  55. !endm
  56.  
  57. ;}}}
  58. ;{{{  7=copy-to-fold
  59. 7       store-macro
  60.   execute-procedure copy-to-fold
  61. !endm
  62.  
  63. ;}}}
  64. ;{{{  8=copy-line
  65. 8       store-macro
  66.   execute-procedure copy-line
  67. !endm
  68.  
  69. ;}}}
  70. ;{{{  9=delete-line
  71. 9       store-macro
  72.   execute-procedure delete-line
  73. !endm
  74.  
  75. ;}}}
  76. ;{{{  10=pick-region
  77. 10      store-macro
  78.   execute-procedure pick-region
  79. !endm
  80.  
  81. ;}}}
  82.  
  83. ;{{{  ; 13 - unfile fold
  84. ; 13 - unfile fold
  85. 13 store-macro
  86.   !if &seq $ltype LSOFOLD
  87.     execute-procedure t-filed
  88.   !else
  89.     execute-procedure t-unfiled
  90.   !endif
  91. !endm
  92.  
  93. ;}}}
  94. ;{{{  ; 14 - comment fold
  95. ; 14 - comment fold
  96. 14      store-macro
  97.   execute-procedure comment-fold
  98. !endm
  99.  
  100.  
  101. ;}}}
  102. ;{{{  ; 15 - uncomment fold
  103. ; 15 - uncomment fold
  104. 15      store-macro
  105.   execute-procedure uncomment-fold
  106. !endm
  107.  
  108. ;}}}
  109. ;{{{  ; 16 - auto fold
  110. ; 16 - auto fold
  111. 16      store-macro
  112.   execute-procedure auto-fold
  113. !endm
  114.  
  115. ;}}}
  116. ;{{{  ; 17 - execute t-listbuf
  117. ; 17 - execute t-listbuf
  118.  
  119. 17      store-macro
  120.   !if %t-lstflg
  121.     execute-procedure t-listbufoff
  122.   !else
  123.     execute-procedure t-listbuf
  124.   !endif
  125. !endm
  126.  
  127. ;}}}
  128.   
  129. ;{{{  ; 21 - create-fold macro
  130. ; 21 - create-fold macro
  131. 21      store-macro
  132.     execute-procedure create-fold
  133. !endm
  134.  
  135. ;}}}
  136. ;{{{  ; 22 - enter fold/file
  137. ;22 - enter fold/file
  138. 22 store-macro
  139.   !if &seq $ltype LSOFOLD 
  140.     !force enter-fold
  141.   !else
  142.     execute-procedure t-enter-filed
  143.   !endif
  144. !endm
  145.  
  146. ;}}}
  147. ;{{{  ; 23 - exit fold/file
  148. ; 23 - exit fold/file
  149. 23 store-macro
  150.   !force exit-fold
  151.   !if ¬ $status
  152.     execute-procedure t-exit-filed
  153.   !endif
  154. !endm
  155.  
  156. ;}}}
  157. ;{{{  ; 24 - exit file
  158. ; 24 - exit fold/file
  159. 24 store-macro
  160.   execute-procedure t-exit-filed
  161. !endm
  162. ;}}}
  163.  
  164. ;{{{  ; 25 - execute t-sa
  165. ; 25 - execute t-sa
  166. 25      store-macro
  167.   execute-procedure t-sa
  168. !endm
  169. ;}}}
  170. ;{{{  ; 26 - execute t-listbuf
  171. ; 26 - execute t-listbuf
  172. 26      store-macro
  173.   execute-procedure t-listbuf
  174. !endm
  175. ;}}}
  176. ;{{{  ; 27 - execute t-gotobuf
  177. ; 27 - execute t-gotobuf
  178. 27      store-macro
  179.   execute-procedure t-gotobuf
  180. !endm
  181. ;}}}
  182. ;{{{  ; 28 - execute t-ctags
  183. ; 28 - execute t-ctags
  184. 28      store-macro
  185.   execute-procedure t-ctags
  186. !endm
  187. ;}}}
  188. ;{{{  ; 29 - execute t-cleartags
  189. ; 29 - execute t-cleartags
  190. 29      store-macro
  191.   execute-procedure t-cleartags
  192. !endm
  193. ;}}}
  194. ;{{{  ; 30 - execute t-delbuf
  195. ; 30 - execute t-delbuf
  196. 30      store-macro
  197.   execute-procedure t-delbuf
  198. !endm
  199. ;}}}
  200.  
  201.  
  202. ;{{{  ; 31 - toggle num pad action
  203. 31      store-macro
  204.   set $discmd FALSE
  205.   !if &seq %escnum "num"
  206.     ;{{{  execute macros
  207.     bind-to-key execute-macro-21        M-1
  208.     bind-to-key execute-macro-13        M-2
  209.     bind-to-key execute-macro-3         M-3
  210.     bind-to-key execute-macro-5         M-4
  211.     bind-to-key execute-macro-6         M-5
  212.     bind-to-key execute-macro-2         M-6
  213.     bind-to-key execute-macro-7         M-7
  214.     bind-to-key execute-macro-17        M-8
  215.     bind-to-key execute-macro-32        M-9
  216.     ;}}}
  217.     set %escnum "fold"
  218.     write-message "[Folding keys set M-1 -> M-9: (toggle M-0)]"
  219.   !else
  220.     ;{{{  unbind keys
  221.     unbind-key  M-1
  222.     unbind-key  M-2
  223.     unbind-key  M-3
  224.     unbind-key  M-4
  225.     unbind-key  M-5
  226.     unbind-key  M-6
  227.     unbind-key  M-7
  228.     unbind-key  M-8
  229.     unbind-key  M-9
  230.     ;}}}
  231.     set %escnum "num"
  232.     write-message "[Numeric keys set: (toggle M-0)]"
  233.   !endif
  234.   set $discmd TRUE
  235. !endm
  236. ;}}}
  237.  
  238. ;{{{  ; 32 - display current line
  239. ; display the current line number in message window
  240. 32    store-macro
  241.   write-message $curline
  242. !endm
  243. ;}}}
  244. ;}}}
  245.  
  246. write-message "[Binding function keys]"
  247.  
  248. ;{{{  ;       ***** Rebind the Function key group
  249. ;       ***** Rebind the Function key group
  250. bind-to-key execute-macro-1             FN1
  251. bind-to-key execute-macro-4             FN3
  252. bind-to-key execute-macro-8             FN4
  253. ;}}}
  254.  
  255. ;{{{  ; arc cursor keys
  256. ; arc cursor keys!
  257. bind-to-key previous-line               FNF
  258. bind-to-key next-line                   FNE
  259. bind-to-key forward-character           FND
  260. bind-to-key backward-character          FNC
  261. bind-to-key previous-page               S-FNF
  262. bind-to-key next-page                   S-FNE
  263. bind-to-key next-word                   S-FND
  264. bind-to-key previous-word               S-FNC
  265. bind-to-key beginning-of-file           FN^F
  266. bind-to-key end-of-file                 FN^E
  267. bind-to-key beginning-of-line           FN^C
  268. bind-to-key end-of-line                 FN^D
  269. bind-to-key delete-next-character       S-FN^E
  270. ;}}}
  271.  
  272.  
  273. write-message "[folding keys]"
  274.  
  275. !if &seq $progname "uEmacs" 
  276.   ;{{{  fold key bindings
  277.   bind-to-key execute-macro-22               FNN
  278.   bind-to-key execute-macro-23               FNP
  279.   bind-to-key open-fold                      FNH
  280.   bind-to-key close-fold                     FNJ
  281.   bind-to-key execute-macro-21               FNG
  282.   
  283.   bind-to-key remove-fold                    FN^P
  284.   bind-to-key quick-exit                     FN^H
  285.   
  286.   ; FNB is copy key - copy top line of fold to comment line
  287.   macro-to-key copy-to-fold                   FNB
  288.   
  289.   macro-to-key auto-fold                     ^A
  290.   
  291.   bind-to-key searchfold-forward                ^S
  292.   bind-to-key searchfold-reverse                ^R
  293.   ;}}}
  294.   ;{{{  set fold marks
  295.   write-message "[fold marks.................................]"
  296.   
  297.   ; set fold marks
  298.   set-fold-marks "c"   "/*{{{  "   "/*}}}*/"   "*/"
  299.   set-fold-marks "h"   "/*{{{  "   "/*}}}*/"   "*/"
  300.   
  301.   set-fold-marks "occ" "--{{{  "   "--}}}"     ""
  302.   set-fold-marks "inc" "--{{{  "   "--}}}"     ""
  303.   set-fold-marks "pgm" "--{{{  "   "--}}}"     ""
  304.   set-fold-marks "cfs" "/*{{{  "   "/*}}}*/"   "*/"
  305.   
  306.   set-fold-marks "mak" "#{{{  "    "#}}}"      ""
  307.   set-fold-marks "tt"  "/*{{{  "   "/*}}}*/"   "*/"
  308.   
  309.   set-fold-marks "rc"  ";{{{  "    ";}}}"      ""
  310.   ;}}}
  311. !else
  312.   ;{{{  normal bindings
  313.   bind-to-key     beginning-of-line       FN<
  314.   bind-to-key     end-of-line             FN>
  315.   ;}}}
  316. !endif
  317.  
  318. ;{{{  set readhook
  319. 20        store-macro
  320. ; arc version - looks AFTER _ or BEFORE .
  321.  
  322.         set %rctmp &sin $cfname "."
  323.  
  324.         !if &eq %rctmp 0
  325.           ;{{{  look for _
  326.           set %rctmp &sin $cfname "_"
  327.           
  328.           !if &eq %rctemp 0
  329.             !return
  330.           !else
  331.             set %rctmp &mid $cfname &add %rctmp 1 5
  332.           !endif
  333.           ;}}}
  334.         !else
  335.           ;{{{  get text before .
  336.           set %rctmp &left $cfname &sub %rctmp 1
  337.           ;}}}
  338.         !endif
  339.  
  340.         write-message %rctmp
  341.         ;{{{  c or h ?
  342.         !if &or &seq %rctmp "c" &seq %rctmp "h"
  343.                 2 handle-tab
  344.                 add-mode cmode
  345.         !endif
  346.         ;}}}
  347.  
  348.         ;{{{  mss ?
  349.         !if &seq %rctmp "mss"
  350.                 add-mode "wrap"
  351.         !endif
  352.         ;}}}
  353.  
  354.         ;{{{  occ or inc ?
  355.         !if &or &seq %rctmp "occ" &seq %rctmp "inc"
  356.                 add-mode "cmode"
  357.                 2 handle-tab
  358.         !endif
  359.         ;}}}
  360.  
  361.         !force add-mode magic
  362.  
  363. ;        !if %t-lstflg
  364. ;          !force execute-procedure t-listbuf
  365. ;        !endif
  366.  
  367. !endm
  368. set $readhook execute-macro-20
  369. ;}}}
  370.   
  371. ;bind-to-key     next-buffer       M-FNN
  372.  
  373. ;{{{  set up help buffer
  374. ; function key help window display
  375. split-current-window
  376. 1 select-buffer "Function Keys"
  377. insert-string "F1=help F2=comment F3=un/c F4=move   | ENTER |  UP | EXIT |~n"
  378. insert-string "M-1=create-fold M-2=file M-3=pick    | copy  _ top _ move |     0        .    ~n"
  379. insert-string "M-5=put M-6=clear M-7=fold-details   | LEFT  |-----| RIGHT| MAKE-FOLD REM-FOLD~n"
  380. insert-string "M-8=list-buff M-9=line-no M-0=toggle |start-l|_____| end-l| auto-fold del-line~n"
  381. insert-string "                                     | OPEN  | DOWN| CLOSE|~n"
  382. insert-string "   Folding Microemacs                | pick  - end - put  |~n"
  383. insert-string "   PCSP - Southampton University     ----------------------~n"
  384. !force add-mode "view"
  385. !force $curline resize-window
  386. unmark-buffer
  387. delete-window
  388. set %rcfkeys FALSE
  389. set %moving FALSE
  390. set $sscroll TRUE
  391. ;execute-macro-1
  392. ;}}}
  393.  
  394. !force add-mode exact
  395. !force add-mode magic
  396.  
  397. !force add-global-mode exact
  398. !force add-global-mode magic
  399.  
  400. 2 handle-tab
  401.  
  402. set $discmd TRUE        
  403.  
  404. write-message "[Setup done]"
  405.  
  406.  
  407.